package com.example.user.customviewdemo.github;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.example.user.customviewdemo.R;
import com.github.rahatarmanahmed.cpv.CircularProgressView;
import com.github.rahatarmanahmed.cpv.CircularProgressViewListener;

import butterknife.Bind;
import butterknife.ButterKnife;

public class CircularProgressViewActivity extends AppCompatActivity {


    @Bind(R.id.progress_view)
    CircularProgressView progressView;
    @Bind(R.id.progress_number_view)
    TextView progressNumberView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_circular_progress_view);
        ButterKnife.bind(this);

        progressView.addListener(new CircularProgressViewListener() {
            @Override
            public void onProgressUpdate(float currentProgress) {
                progressNumberView.setText(currentProgress+"%100");
            }

            @Override
            public void onProgressUpdateEnd(float currentProgress) {

            }

            @Override
            public void onAnimationReset() {

            }

            @Override
            public void onModeChanged(boolean isIndeterminate) {

            }
        });

    }
}
